﻿using FunctionalCLR.Core;

namespace FunctionalCLR.Shell {
    public class ContextDependencyManager {

        private IParserFactory cpf = null;

        private IFunctionManager cfm = null;

        public IContext Context {
            get;
            set;
        }

        public ContextDependencyManager(IContext context) {
            this.Context = context;

            this.cfm = new ContextFunctionManager(context);
            this.cpf = new ContextParserFactory(context);
        }

        public static ContextDependencyManager Instance {
            get;
            set;
        }


        public IFunctionManager FunctionManager {
            get {
                return cfm;
            }
        }

        public IConstantManager ConstantManager {
            get {
                return DefaultDependencyManager.Instance.ConstantManager;
            }
        }

        public IExpressionCompiler ExpressionCompiler {
            get {
                return DefaultDependencyManager.Instance.ExpressionCompiler;
            }
        }

        public IParserFactory ParserFactory {
            get {
                return this.cpf;
            }
        }
    }
}
